package dev.bong.vo;

import dev.bong.pojo.entity.User;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author: bong~
 * @description: TODO
 * @date: 2024/4/11 20:54
 * @version: 1.0
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("学生信息")
public class StudentVo {


    private String userAccount;
    private String userPassword;
    private String userName;
    private String major;
    private String className;

    public static User toUser(StudentVo vo){
        User user=new User();
        user.setUserAccount(vo.getUserAccount());
        user.setUserPassword(vo.getUserPassword());
        user.setUserName(vo.getUserName());
        user.setMajor(vo.getMajor());
        user.setClassName(vo.getClassName());

        return user;
    }

    public static  StudentVo toStudentVo(User user){
        StudentVo studentVo=new StudentVo();
        studentVo.setUserAccount(user.getUserAccount());
        studentVo.setUserPassword(user.getUserPassword());
        studentVo.setUserName(user.getUserName());
        studentVo.setClassName(user.getClassName());
        studentVo.setMajor(user.getMajor());

        return studentVo;
    }

    
}
